import numpy as np 
import glumpy

fig = glumpy.figure( (800,800) )
img_arr = np.ones((400,400), dtype=np.float32)
# img_arr = np.random.random((400,400)).astype(np.float32)
print img_arr
img_arr[200:300,100:300] -= 1.0

# now we convert the array of numbers into an image texture 
image = glumpy.image.Image(img_arr)

def on_draw():
    fig.clear()
    image.update()
    image.draw( x=0, y=0, z=0, width=fig.width, height=fig.height )

fig.window.push_handlers(on_draw)
fig.window.set_title("my simple image viewer")

glumpy.show()